﻿using System;
using System.Collections.Generic;

namespace Meqs.Entity
{
    /// <summary>
    /// 学区信息
    /// </summary>
    [Serializable]
    public class SchoolArea
    {
        public SchoolArea()
        {
        }

        public SchoolArea(int rID, string schoolAreaMark, string schoolAreaName)
        {
            _rID = rID;
            _schoolAreaMark = schoolAreaMark;
            _schoolAreaName = schoolAreaName;
        }

        private int _rID;
        private string _schoolAreaMark;
        private string _schoolAreaName;

        public int RID
        {
            get { return _rID; }
            set { _rID = value; }
        }

        public string SchoolAreaMark
        {
            get { return _schoolAreaMark; }
            set { _schoolAreaMark = value; }
        }

        public string SchoolAreaName
        {
            get { return _schoolAreaName; }
            set { _schoolAreaName = value; }
        }

        public bool Equals(SchoolArea other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return other._rID == _rID;
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != typeof (SchoolArea)) return false;
            return Equals((SchoolArea) obj);
        }

        public override int GetHashCode()
        {
            return _rID;
        }
    }
}